package com.example.com.skills_utf8;

import android.app.Fragment;
import android.graphics.AvoidXfermode;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Shader;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;


//
public class _64_2Fragment extends Fragment {



    LinearLayout layout_a, layout_b, bar_container;
    TextView tv_a;
    TextView tv_b;



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {


        View view = inflater.inflate(R.layout.fragment_64_2, container, false);


        Bitmap shader_bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.category_select);
        BitmapShader shader = new BitmapShader(shader_bitmap, Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);  // shader可以设置matrix


        Paint paint = new Paint();
        paint.setShader(shader);


        Rect rect = new Rect(0,0,480,800);
        ImageView iv_content = (ImageView)view.findViewById(R.id.iv_content);
        Bitmap bitmap = Bitmap.createBitmap(480, 800, Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
        canvas.drawRect(rect, paint);

        //RectF rect_f = new RectF(0,0,480,800);
        //canvas.drawArc(rect_f, -90, 90, false, paint);

        iv_content.setImageBitmap(bitmap);


        //PorterDuffXfermode  xmode = new PorterDuffXfermode(PorterDuff.Mode.SRC);



        return view;

    }







}
